package com.lyf.scm.job.remote.facade;

import com.lyf.scm.common.enums.ResponseMsg;
import com.lyf.scm.job.remote.SalesOtherPlanRemoteService;
import com.lyf.scm.job.remote.UpdatePlanCancelStatusRemoteService;
import com.rome.arch.core.clientobject.Response;
import com.rome.arch.core.exception.RomeException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * description:
 * 其他渠道计划Job
 * @author: huangtao
 * @data: 2020/9/5
 */
@Slf4j
@Component
public class UpdatePlanCancelStatusFacade {

    @Resource
    private UpdatePlanCancelStatusRemoteService updatePlanCancelStatusRemoteService;

    public void updatePlanCancelStatus() {
        Response response = updatePlanCancelStatusRemoteService.updatePlanCancelStatus();
        if (!ResponseMsg.SUCCESS.getCode().equals(response.getCode())) {
            throw new RomeException(response.getCode(), response.getMsg());
        }
    }
}
